/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ARELLANO RODRIGUEZ
 */
@Entity
@Table(name = "area")
@NamedQueries({
    @NamedQuery(name = "Area.findAll", query = "SELECT a FROM Area a"),
    @NamedQuery(name = "Area.findByCodigoArea", query = "SELECT a FROM Area a WHERE a.codigoArea = :codigoArea"),
    @NamedQuery(name = "Area.findByDescripcionArea", query = "SELECT a FROM Area a WHERE a.descripcionArea = :descripcionArea")})
public class Area implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "codigo_area")
    private Integer codigoArea;
    @Size(max = 30)
    @Column(name = "descripcion_area")
    private String descripcionArea;

    public Area() {
    }

    public Area(Integer codigoArea) {
        this.codigoArea = codigoArea;
    }

    public Integer getCodigoArea() {
        return codigoArea;
    }

    public void setCodigoArea(Integer codigoArea) {
        this.codigoArea = codigoArea;
    }

    public String getDescripcionArea() {
        return descripcionArea;
    }

    public void setDescripcionArea(String descripcionArea) {
        this.descripcionArea = descripcionArea;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoArea != null ? codigoArea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Area)) {
            return false;
        }
        Area other = (Area) object;
        if ((this.codigoArea == null && other.codigoArea != null) || (this.codigoArea != null && !this.codigoArea.equals(other.codigoArea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Area[ codigoArea=" + codigoArea + " ]";
    }
    
}
